import { defHttp } from '/@/utils/http/axios';
// import { FlowResult } from './model';
import { UploadFileParams } from '/#/axios';

enum Api {
  ReviewFlow = '/workflow/workItemInst/getWorkItem',
  ImportFlow = '/workflow/workItemInst/importCyclostyle',
  ExportFlow = '/workflow/workItemInst/exportCyclostyle',
}

export const getReviewFlowApi = (params: Recordable) =>
  defHttp.get<string>({
    url: Api.ReviewFlow,
    params,
  });

export function importFlowApi(
  params: UploadFileParams,
  onUploadProgress?: (progressEvent: ProgressEvent) => void,
) {
  return defHttp.uploadFile<any>(
    {
      url: Api.ImportFlow,
      onUploadProgress,
    },
    params,
  );
}
